﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ReportModel
{
   public class DaysOfWeek
    {


        public static void  bindingCombox(ComboBox comboBox1,ComboBox comboBox2,Setings setings)
        {
            Dictionary<int, string> daysInWeek1 = new Dictionary<int, string>();
            daysInWeek1.Add(1, "周一");
            daysInWeek1.Add(2, "周二");
            daysInWeek1.Add(3, "周三");
            daysInWeek1.Add(4, "周四");
            daysInWeek1.Add(5, "周五");
            daysInWeek1.Add(6, "周六");
            daysInWeek1.Add(7, "周日");
            BindingSource bs = new BindingSource();
            bs.DataSource = daysInWeek1;
            comboBox1.DataSource = bs;
            comboBox1.ValueMember = "Key";
            comboBox1.DisplayMember = "Value";
            comboBox1.SelectedValue= setings.weekStart;
            Dictionary<int, string> daysInWeek2 = new Dictionary<int, string>();
            daysInWeek2.Add(1, "周一");
            daysInWeek2.Add(2, "周二");
            daysInWeek2.Add(3, "周三");
            daysInWeek2.Add(4, "周四");
            daysInWeek2.Add(5, "周五");
            daysInWeek2.Add(6, "周六");
            daysInWeek2.Add(7, "周日");
            BindingSource bs1 = new BindingSource();
            bs1.DataSource = daysInWeek2;
            comboBox2.DataSource = bs1;
            comboBox2.ValueMember = "Key";
            comboBox2.DisplayMember = "Value";
            comboBox2.SelectedValue= setings.weekEnd;
        }
    }
}
